<template>
	<view :class="Visible ? 'product-popup open' : 'product-popup close'" @touchmove.stop.prevent=""
		@click="closePopup">
		<view class="popup-bg"></view>
		<view class="main" v-on:click.stop>
			<view class="header">
				<image :src="form.showSku.skuImage" mode="aspectFit" class="avt"></image>
				<view class="price">
					¥
					<text class="num">{{ token && UserState == '20'?form.showSku.productPrice:'**' }}</text>
					<text class="old-price"
						v-if="form.showSku.linePrice">¥{{ token && UserState == '20'?form.showSku.linePrice:"**" }}</text>
				</view>
				<view class="stock">库存：{{ token && UserState == '20'?form.showSku.stockNum:'**' }}</view>
				<view class="stock stockRed">最小起订量：{{ token && UserState == '20'?minStock:'**'  }}</view>
				<view class="select_spec">基地：{{ form.detail.produceName }}</view>
				<view class="select_spec" style="white-space: break-spaces;">{{ selectSpec }}</view>
				<view class="close-btn" @click="closePopup"><text class="icon iconfont icon-guanbi"></text></view>
			</view>
			<view class="tagMain" v-if="priceOptions.length>0">
				<view class="tagItem" v-for="(n,index) in priceOptions" :key="index">
					{{ n.name}} <text style="color:#ffda00"> ¥ {{token && UserState == '20'?n.price:'**'}}</text>
				</view>
			</view>
			<view class="body">
				<!--规格-->
				<view>
					<scroll-view scroll-y="true" class="specs mt20" style="max-height: 600rpx;" v>
						<view v-for="(item_attr, attr_index) in specGroup" :key="attr_index">
							<view class="gray3">
								{{ attr_index  }}
								<!-- 如果是预售的批次单独处理 -->
								<view class="item-card" v-if="attr_index == '批次'">
									<view v-for="(p,index) in item_attr.filter(val=>val.productSkuId == btchProductSkuId)" >
										<view @click="onHandlerClick(p)" :class="[p.check? 'item-check':'','item-lit']" v-if="p.name">
											{{ p.name }}
										</view>
									</view>
								</view>
								<view class="item-card" v-else>
									<view v-for="(p,index) in item_attr" >
										<view @click="onHandlerClick(p)" :class="[p.check? 'item-check':'','item-lit']" v-if="p.name">
											{{ p.name }}
										</view>
									</view>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<!--选择数量-->
				<view class="level-box count_choose">
					<text class="key">数量</text>
					<view class="d-s-c">
						<view class="icon-box minus d-c-c" @click="sub()" :class="{ 'num-wrap': !issub }">
							<text class="icon iconfont icon-jian" style="font-size: 20rpx;color: #333333;"></text>
						</view>
						<view class="text-wrap"><input type="text" v-model="form.showSku.sum" /></view>
						<view class="icon-box plus d-c-c" :class="{ 'num-wrap': !isadd }" @click="add()">
							<text class="icon iconfont icon-jia" style="font-size: 20rpx;color: #333333;"></text>
						</view>
					</view>
				</view>
				<!-- 计算费用 -->

				<view class="hj">
					合计：
					<text class="prix">¥</text>
					<text class="hjText">
						{{token && UserState == '20'?sumTotal:"**" }}
					</text>
				</view>
			</view>
			<view class="btns">
				<button class="confirm-btn" v-if="!clock" @click="confirmFunc(form)">确认</button>
				<button class="confirm-btn" v-else>暂无库存</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				/*是否可见*/
				Visible: false,
				/*表单对象*/
				form: {
					detail: {},
					showSku: {
						skuImage: ''
					}
				},
				/*当前商品总库存*/
				stock: 0,
				/*选择提示*/

				/*是否打开过多规格选择框*/
				isOpenSpec: false,
				type: '',
				clock: false,
				specGroup: {},
				defaultGroup: {},
				selectSpec: '', //选择的规格
				selectColor: '', //选择的颜色
				selcePrice: 0, //选择价格
				minStock: 0, //最小限定购买量
				maxStock: 0, //最大限定购买量
				priceOptions: [],
				defaultImage: '',
				batchId: '', //批次
				activityid: 0, //活动id 
				sumTotal: 0, //合计
				token:uni.getStorageSync('token'),
				UserState:uni.getStorageSync('UserState'),
				btchProductSkuId:'',
				newBatchlist:[]
			};
		},
		props: ['isPopup', 'productModel'],
		onLoad() {},
		onShow() {
		},
	
		mounted() {
			console.log(this.productModel,'productModel')
		},
		computed: {
			/*判断增加数量*/
			isadd: function() {
				return this.form.showSku.sum >= this.stock ||
					this.form.showSku.sum >= this.form.detail.limitNum;
			},

			/*判断减少数量*/
			issub: function() {

				return this.form.showSku.sum <= 1;
			}
		},
		watch: {
			isPopup: function(n, o) {
				if (n != o) {
					this.Visible = n;
					this.form = this.productModel;
					this.initSpac(this.productModel.detail)
					this.setDefaultSpec(this.productModel.detail)
					this.form.type = this.productModel.type;
				}
			},
			"form.showSku.sum": {
				handler(v) {
					if (v) {
						if (v < this.minStock) {
							uni.showToast({
								title: '此规格的商品最小起订量为' + this.minStock,
								icon: 'none',
								duration: 2000
							});
							this.form.showSku.sum = this.minStock;
							return false;
						}
						if (v > this.maxStock) {
							uni.showToast({
								title: '当前购买的数量超过了当前规格库存',
								icon: 'none',
								duration: 2000
							});
							this.form.showSku.sum = this.minStock;
							return
						}
						if(v > this.form.showSku.stockNum){
							uni.showToast({
								title: '该商品库存为'+this.form.showSku.stockNum,
								icon: 'none',
								duration: 2000
							});
							this.form.showSku.sum = this.form.showSku.stockNum
							return;
						}else{
							this.cacluteTotalPrice();
						}
					}
				},
				deep:true,
				immediate:false
			}
		},
		methods: {
			/*初始化*/
			initShowSku() {
				// this.form.showSku.skuImage = this.form.detail.image[0].filePath;
				this.form.showSku.productPrice = this.form.detail.productPrice;
				if (this.form.detail.specType == 20) {
					this.form.showSku.productPrice = this.form.detail.productPrice + '-' + this.form.detail.highPrice;
				}
				this.form.showSku.specSkuId = 0;
				this.form.showSku.linePrice = this.form.detail.linePrice;
				this.form.showSku.stockNum = this.form.detail.productStock;
				this.form.showSku.sum = 1;
				// this.stock = this.form.detail.productStock;
				if (this.form.plusName == 'advance') {
					this.form.showSku.productPrice = this.form.plusSku[0].productPrice;
					this.form.showSku.linePrice = '';
					this.form.showSku.skuImage = this.form.plusSku[0].productSku.image ? this.form.plusSku[0].productSku
						.image.filePath : this.form.detail.image[0].filePath;
					this.form.showSku.stockNum = this.form.plusSku[0].advanceStock;
					// this.stock = this.form.plusSku[0].advanceStock;
				}
				if (this.form.plusName == 'seckill') {
					this.form.showSku.productPrice = this.form.plusSku[0].seckillPrice;
					this.form.showSku.linePrice = this.form.plusSku[0].productPrice;
					this.form.showSku.skuImage = this.form.plusSku[0].productSku.imagePath ? this.form.plusSku[0]
						.productSku.imagePath : this.form.detail.image[0].filePath;
					this.form.showSku.stockNum = this.form.plusSku[0].seckillStock;
					// this.stock = this.form.plusSku[0].seckillStock;
				}
			},
			initSpac(item) {
				console.log('弹出数据', item)
				const $this = this
				if (item.categoryParentName != '农资') {
					$this.specGroup['品种'] = []
					this.specGroup['规格'] = []
					$this.specGroup['颜色'] = []
				} else {
					$this.specGroup['品种'] = []
					this.specGroup['规格'] = []
					this.specGroup['类型'] = []
				}
				if (item.image && item.image.length > 0)
					this.defaultImage = item.image[0].filePath;
				if (item) {
					this.specGroup['品种'] = [{
						name: item.categoryParentName,
						check: true,
						pname: '品种'
					}]
					//规格
					this.specGroup['规格'] = [{
						name: item.spec,
						check: true,
						pname: '规格'
					}]
					
					if (item.skuList && item.skuList.length > 0) {
						item.skuList.forEach(f => {
							if (item.categoryParentName === '农资') {
								const colorList = $this.specGroup['类型']
								const colorItem = colorList.find(d => d.name === f.type)
								console.log(!colorItem,'colorItem')
								if (!colorItem) {
									$this.specGroup['类型'].push({
										name: f.type,
										check: false,
										pname: '类型',
										stock: f.stockNum, //库存,
										productPrice: f.productPrice, //产品价格
										linePrice: f.linePrice, //划线价
										minStock: f.minBuyCount, //最小起订量
										...f
									})
								}
							} else {
								const colorList = $this.specGroup['颜色']
								const colorItem = colorList.find(d => d.name === f.color)
								if (!colorItem) {
									$this.specGroup['颜色'].push({
										name: f.color,
										check: false,
										pname: '颜色',
										stock: f.stockNum, //库存,
										productPrice: f.productPrice, //产品价格
										linePrice: f.linePrice, //划线价
										minStock: f.minBuyCount, //最小起订量
										options: [{
												name: item.categoryParentName + '优惠价(一万)',
												price: f.tenThousandPrice
											},
											{
												name: item.categoryParentName + '优惠价(十万):',
												price: f.lakhPrice
											},

										],
										...f
									})
								}
							}
						})
					}
				}
				if (item.secKill && item.secKill.activityType === 4) {
					this.specGroup['批次'] = []
					const batchlist = item.secKill.productBatchList
					// 单独处理新的批次
					console.log(item.skuList)
					if(item.skuList && item.skuList.length){
						item.skuList.map(ku=>{
							if(ku.productBatchList){
								ku.productBatchList.map(pro=>{
									this.newBatchlist.push(pro)
								})
							}
						})
					}
					console.log(this.newBatchlist,'newBatchlist')
					// productSkuId 不一样
					if (this.newBatchlist && this.newBatchlist.length > 0) {
						this.newBatchlist.forEach(btch => {
							this.specGroup['批次'].push({
								...btch,
								name: btch.batchNo,
								check: false,
								pname: '批次',
								productSkuId:btch.productSkuId,
								stock: btch.batchStock,

							})
						})
						console.log('批次',this.specGroup['批次'])
					}
				}
			},
			//设置默认的规格
			setDefaultSpec(item) {
				if (item.categoryParentName === '农资') {
					this.onHandlerClick(this.specGroup['类型'][0])
				} else {
					const colors = this.specGroup['颜色']
					if (colors && colors.length > 0) {
						this.specGroup['颜色'][0].check = true
						this.onHandlerClick(this.specGroup['颜色'][0])
						//设置批次
						if (this.specGroup['批次'] && this.specGroup['批次'].length > 0)
							this.onHandlerClick(this.specGroup['批次'][0])
					}
				}

			},
			onHandlerClick(e) {
				console.log(e, 'eeeeeeeeee')
				if (e && e.pname == '品种') {
					return
				}
				const $this = this
				const groups = $this.specGroup
				const priceData = $this.defaultGroup['整体价格']
				const specList = $this.specGroup['规格']
				const speclxList = $this.specGroup['类型']
				if (e.name !== '农资') {
					$this.specGroup[e.pname].forEach(f => {
						f.check = false
					})
				}
				if (e && e.pname === '颜色') {
					const list = groups[e.pname]
					this.btchProductSkuId = e.productSkuId;
					if (list) {
						const findex = list.findIndex(f => f.name === e.name)
						if (findex > -1) {
							$this.specGroup[e.pname][findex].check = true
							const fItem = list.find(f => f.name === e.name)
							if (fItem) {
								$this.form.showSku.productPrice = Number(fItem.productPrice)
								$this.form.showSku.linePrice = Number(fItem.linePrice)
								$this.form.showSku.stockNum = fItem.stock //设置当前规格的库存
								$this.minStock = fItem.minStock
								$this.maxStock = fItem.stock
								$this.priceOptions = fItem.options
								$this.form.showSku.specSkuId = fItem.productSkuId
								$this.form.showSku.sum = fItem.minStock
								$this.form.showSku.skuImage = fItem.imagePath ?? $this.defaultImage
							}
						}
					}
				} else if (e && e.pname === '规格') {
					const finex = specList.findIndex(f => f.name === e.name)
					if (finex > -1)
						$this.specGroup['规格'][finex].check = true
				} else if (e && e.pname == '类型') {
					console.log('类型',e)
					const list = groups[e.pname]
					e.check = !e.check
					const finex = speclxList.findIndex(f => f.name === e.name)
					if (list) {
						const findex = list.findIndex(f => f.name === e.name)
						if (findex > -1) {

							//选择默认的批次
							$this.specGroup['规格'][finex].check = true
							const fItem = list.find(f => f.name === e.name)
							if (fItem) {
								$this.form.showSku.productPrice = Number(fItem.productPrice)
								$this.form.showSku.linePrice = Number(fItem.linePrice)
								$this.form.showSku.stockNum = fItem.stock //设置当前规格的库存
								$this.minStock = fItem.minStock
								$this.maxStock = fItem.stock
								$this.form.showSku.skuImage = fItem.imagePath ?? $this.defaultImage
								$this.form.showSku.specSkuId = fItem.productSkuId
								this.form.showSku.sum = fItem.minStock
							}
						}
					}
				} else if (e && e.pname === '批次') {
					//获取当前批次
					const list = $this.specGroup['批次']
					const fitem = list.find(f => f.seckillProductBatchId === e.seckillProductBatchId)
					const finex = list.findIndex(f => f.seckillProductBatchId === e.seckillProductBatchId)
					if (fitem) {
						$this.specGroup['批次'][finex].check = true
						//设置库存
						$this.minStock = fitem.stock
						$this.maxStock = fitem.stock
						$this.form.showSku.stockNum = fitem.stock
						$this.form.showSku.sum = 1
						$this.batchId = fitem.seckillProductBatchId
						$this.activityid = fitem.seckillActivityId
					}
				}
				const keys = []
				Object.keys(groups).forEach(key => {
					const list = groups[key]
					if (list) {
						const fitem = list.find(f => f.check)
						if (fitem) {
							const value = `${key}:${fitem.name}`
							keys.push(value)
						}
					}
				})
				$this.selectSpec = '已选: ' + keys.join('  ')
				this.cacluteTotalPrice()
			},
			/*选择属性*/
			selectAttr(attr_index, item_index) {
				let self = this;
				let items = self.form.specData.specAttr[attr_index].specItems;
				let curItem = items[item_index];
				if (curItem.checked) {
					curItem.checked = false;
					self.form.productSpecArr[attr_index] = null;
				} else {
					for (let i = 0; i < items.length; i++) {
						items[i].checked = false;
					}
					curItem.checked = true;
					self.form.productSpecArr[attr_index] = curItem.itemId;
				}

				for (let i = 0; i < self.form.productSpecArr.length; i++) {
					if (self.form.productSpecArr[i] == null) {
						self.initShowSku();
						return;
					}
				}

				// 更新商品规格信息
				self.updateSpecProduct();
			},

			/*更新商品规格信息*/
			updateSpecProduct() {
				let self = this;
				let specSkuId = self.form.productSpecArr.join('_');
				// 查找skuItem
				let specList = self.form.specData.specList;
				if (self.form.plusSku != null) {
					specList = self.form.plusSku;
				}
				let skuItem = specList.find(val => {
					if (self.form.plusName) {
						return val.productSku.specSkuId == specSkuId;
					} else {
						return val.specSkuId == specSkuId;
					}
				});
				if (!skuItem) {
					self.clock = true;
					self.initShowSku();
					return;
				} else {
					self.clock = false;
				}
				if (self.form.plusName && !skuItem.specForm) {
					skuItem.specForm = skuItem.productSku;
				}
				// 记录product_sku_id
				// 更新商品价格、划线价、库存
				if (typeof skuItem === 'object') {
					/*保存当前规格*/
					console.log(skuItem);
					self.stock = skuItem.specForm.stockNum;
					if (self.form.showSku.sum > self.stock) {
						self.form.showSku.sum = self.stock > 0 ? self.stock : 1;
					}
					self.form.showSku.specSkuId = specSkuId;
					self.form.showSku.productPrice = skuItem.specForm.productPrice;
					self.form.showSku.linePrice = skuItem.specForm.linePrice;
					if (skuItem.specForm.imageId > 0) {
						self.form.showSku.skuImage = skuItem.specForm.imagePath;
					} else {
						self.form.showSku.skuImage = self.form.detail.image[0].filePath;
					}
					self.form.showSku.stockNum = skuItem.specForm.stockNum;
					if (self.form.plusName) {
						self.form.showSku.productPrice = skuItem.productPrice;
						if (self.form.plusName == 'seckill') {
							self.form.showSku.productPrice = skuItem.seckillPrice;
						}
						self.form.showSku.stockNum = skuItem[self.form.plusName + 'Stock'];
						self.form.showSku.linePrice = '';
						self.form.showSku.skuImage = skuItem.specForm.imagePath ? skuItem.specForm.imagePath : self.form
							.detail.imagePath;
						self.form.showSku.advanceProductId = skuItem.specForm.imagePath ? skuItem.specForm.imagePath : self
							.form.detail.imagePath;
					}
				}
			},

			/*关闭弹窗*/
			closePopup() {
				this.$emit('close', this.form.specData, null);
			},

			/*确认提交*/
			confirmFunc() {
				if (this.form.specData != null) {
					for (let i = 0; i < this.form.productSpecArr.length; i++) {
						if (this.form.productSpecArr[i] == null) {
							uni.showToast({
								title: '请选择规格',
								icon: 'none',
								duration: 2000
							});
							return;
						}
					}
				}
				if(this.form.showSku.sum == 0){
					uni.showToast({
						title: '请选择数量',
						icon: 'none',
						duration: 2000
					});
					return;
				}
				if (this.form.type == 'card') {
					this.addCart();
				} else if (this.form.type == 'order') {
					this.createdOrder();
				} else if (this.form.type == 'deposit') {
					this.createdOrder();
				}
			},

			/*加入购物车*/
			addCart() {
				const $this = this
				let allSpeckData = $this.specGroup['颜色']
				if (!allSpeckData)
					allSpeckData = $this.specGroup['类型']
				const checkItem = allSpeckData.find(f => f.check)
				console.log('item', checkItem)
				if (!checkItem) {
					uni.showToast({
						title: '请选择属性',
						icon: 'none',
						duration: 2000
					});
					return false;
				}
				const addChartJson = {
					specSkuId: checkItem.productSkuId,
					productId: checkItem.productId,
					totalNum: $this.form.showSku.sum,
					activityId: $this.activityid,
					batchId: $this.batchId

				}
				console.log('加入购物车', addChartJson)
				$this._post(
					'order/cart/add', addChartJson,
					function(res) {
						uni.showToast({
							title: res.msg,
							duration: 2000
						});
						setTimeout(() => {
							$this.$emit('close', null, res.data);
						}, 1500)
					}
				);
			},

			/*创建订单*/
			createdOrder() {
				let productId = this.form.detail.productId;
				let productNum = this.form.showSku.sum;
				let productSkuId = this.form.showSku.productSkuId;
				let specSkuId = this.form.showSku.specSkuId;
				let batchId = this.batchId;
				let url = 'orderpages/order/saveOrder?productId=' + productId + '&productNum=' + productNum +
					'&specSkuId=' +
					specSkuId + '&orderType=buy' + '&activityId=' + this.form.seckillActivityId + '&batchId=' + batchId;
				if (this.form.type == 'deposit') {
					if (this.form.plusName == 'advance') {
						let skuItem = this.form.detail.advance.sku.find(val => {
							return val.productSku.specSkuId == specSkuId;
						});
						url =
							'orderpages/order/saveOrder?productId=' +
							productId +
							'&productNum=' +
							productNum +
							'&productSkuId=' +
							specSkuId +
							'&advanceProductSkuId=' +
							skuItem.advanceProductSkuId +
							'&advanceProductId=' +
							skuItem.advanceProductId +
							'&orderType=deposit' +
							'&activityId=' + this.form.seckillActivityId + '&batchId=' + batchId
					}
					if (this.form.plusName == 'seckill') {
						let skuItem = this.form.detail.secKill.seckillSku.find(val => {
							return val.productSku.specSkuId == specSkuId;
						});
						console.log(skuItem);
						console.log(specSkuId);
						url =
							'orderpages/order/saveOrder?seckillProductId=' +
							skuItem.seckillProductId +
							'&productNum=' +
							productNum +
							'&productSkuId=' +
							skuItem.productSku.specSkuId +
							'&seckillProductSkuId=' +
							skuItem.seckillProductSkuId +
							'&orderType=seckill' +
							'&activityId=' + this.form.seckillActivityId + '&batchId=' + batchId
					}
				}
				this.gotoPage(url);
			},

			/*商品增加*/
			add() {
				if (this.maxStock <= 0) {
					return;
				}
				if (this.form.showSku.sum >= this.maxStock) {
					uni. showToast({
						title: '当前购买的数量超过了当前规格库存',
						icon: 'none',
						duration: 2000
					});
					return false;
				}
				this.form.showSku.sum++;
				this.cacluteTotalPrice()
			},

			/*商品减少*/
			sub() {
				const $this = this
				const minValue = $this.minStock
				if (this.maxStock <= 0) {
					return;
				}
				if (this.form.showSku.sum <= minValue) {
					uni.showToast({
						title: '此规格的商品最小起订量为' + minValue,
						icon: 'none',
						duration: 2000
					});
					return false;
				}
				this.form.showSku.sum--;
				this.cacluteTotalPrice()
			},
			cacluteTotalPrice() {
				const $this = this
				let allSpeckData = $this.specGroup['颜色']
				if (allSpeckData) {
					const checkItem = allSpeckData.find(f => f.check)
					if (checkItem) {
						const count = $this.form.showSku.sum
						const price = Number(checkItem.productPrice)

						$this.sumTotal = (count * price).toFixed(2)

					}
				} else {
					allSpeckData = $this.specGroup['类型']
					const checkItem = allSpeckData.find(f => f.check)
					if (checkItem) {
						const count = $this.form.showSku.sum
						const price = Number(checkItem.productPrice)

						$this.sumTotal = (count * price).toFixed(2)

					}
				}

				//if(ch)

			}


		}
	};
</script>

<style lang="scss">
	.product-popup {}

	.product-popup .popup-bg {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background: rgba(0, 0, 0, 0.6);
		z-index: 99;
	}

	.product-popup .main {
		position: fixed;
		width: 100%;
		bottom: 0;
		min-height: 200rpx;
		// max-height: 1050rpx;
		background-color: #fff;
		transform: translate3d(0, 980rpx, 0);
		transition: transform 0.2s cubic-bezier(0, 0, 0.25, 1);
		// bottom: 0;
		z-index: 999;
		border-radius: 12rpx;
	}

	.product-popup.open .main {
		transform: translate3d(0, 0, 0);
	}

	.product-popup.close .popup-bg {
		display: none;
	}

	.product-popup.close .main {
		display: none;
		z-index: -1;
	}

	.product-popup .header {
		min-height: 200rpx;
		padding: 40rpx 0 10rpx 250rpx;
		position: relative;
		border-bottom: 1px solid #eeeeee;
	}

	.product-popup .header .avt {
		position: absolute;
		top: 40rpx;
		left: 30rpx;
		width: 180rpx;
		height: 180rpx;
		border: 2px solid #ffffff;
		background: #ffffff;
		border-radius: 12rpx;
	}

	.product-popup .header .stock {
		font-size: 28rpx;
		color: #999999;
	}

	.product-popup .close-btn {
		position: absolute;
		width: 40rpx;
		height: 40rpx;
		top: 40rpx;
		right: 30rpx;
	}

	.product-popup .price {
		@include font_color('price_color');
		font-size: 24rpx;
	}

	.product-popup .price .num {
		padding: 0 4rpx;
		font-size: 40rpx;
	}

	.product-popup .old-price {
		margin-left: 10rpx;
		font-size: 28rpx;
		color: #999999;
		text-decoration: line-through;
	}

	.product-popup .body {
		padding: 20rpx 30rpx 39rpx 30rpx;
		// max-height: 600rpx;
		overflow-y: auto;
	}

	.product-popup .level-box {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.product-popup .level-box .key {
		font-size: 24rpx;
		color: #999999;
	}

	.product-popup .level-box .icon-box {
		width: 48rpx;
		height: 40rpx;
		background: #e0e0e0;
	}

	.product-popup .num-wrap .iconfont {
		color: #666;
	}

	.product-popup .num-wrap.no-stock .iconfont {
		color: #cccccc;
	}

	.stockRed {
		color: red !important
	}

	.product-popup .level-box .text-wrap {
		margin: 0 4rpx;
		height: 60rpx;
		border: none;
		background: #ffffff;
	}

	.product-popup .level-box .text-wrap input {
		padding: 0 10rpx;
		height: 60rpx;
		line-height: 60rpx;
		width: 80rpx;
		font-size: 32rpx;
		text-align: center;
	}

	.specs .specs-list {
		float: left;
	}

	.specs .specs-hd {
		margin-top: 70rpx;
	}

	.specs .specs-list button {
		margin-right: 10rpx;
		margin-bottom: 10rpx;
		font-size: 24rpx;
	}

	.specs .specs-list button:after,
	.product-popup .btns button,
	.product-popup .btns button:after {
		height: 88rpx;
		line-height: 88rpx;
		border: 0;
		border-radius: 0;
		margin-bottom: 55rpx;
	}

	.product-popup .btns .confirm-btn {
		width: 710rpx;
		height: 80rpx;
		@include background_linearmore('cart_right1', 'cart_right2', 'right_deg', 0%, 100%);
		border-radius: 40rpx;
		margin: 0 auto;
		margin-bottom: 55rpx;
		color: #ffffff;
		line-height: 80rpx;
		font-size: 32rpx;
	}

	.btn-checked {
		border: 1rpx solid #f6220c;
		@include border_color('background_color');
		border-radius: 6px;
		@include font_color('font_color');
		font-size: 28rpx;
		background-color: #ffffff;
	}

	.btn-checke {
		border: 1rpx solid #d9d9d9;
		border-radius: 6rpx;
		font-size: 28rpx;
		color: #333333;
		background-color: #ffffff;
	}

	.item-card {
		display: flex;
		gap: 10rpx;
		flex-direction: row;
		padding: 10rpx;
		flex-wrap: wrap;

		.item-lit {
			border: 1rpx solid #d9d9d9;
			border-radius: 6rpx;
			font-size: 28rpx;
			color: #333333;
			background-color: #ffffff;
			padding: 10rpx 20rpx;

		}

		.item-check {
			background: #19a352;
			color: #fff;
		}

	}

	.hj {
		height: 30rpx;
		line-height: 30rpx;
		font-size: 40rpx;
		color: red;
		background: #ffff;
		border-top: 1px solid #ebebeb;
		padding-top: 10px;

		.prix {
			font-size: 30rpx;
			padding-right: 10rpx;
		}

		.hjText {
			font-weight: bold;
		}
	}

	.tagMain {
		display: flex;
		flex-wrap: wrap;
	}

	.tagMain .tagItem {
		height: 35rpx;
		padding: 15rpx;
		gap: 10rpx;
		margin: 5rpx;
		background: #fff;
		border: 2rpx solid #19a352;
		color: #19a352;
		border-radius: 6rpx;
		font-size: 28rpx;
	}
</style>